#include "../common/common.h"
#include "svm.h"
#ifndef _SVM_HEADER_
#define _SVM_HEADER_


class SVMTrain
{
 public:
  SVMTrain(const char * _svmModelFile, const char * _svmConfigureFile, const char * _svmPositiveFeaturePath, const char * _svmNegetiveFeaturePath);
  ~SVMTrain();
 public:
  void trainSvmModel() ;
 private:
  void readConfigureFile(const char *, svm_parameter&) ;
  void readFeature(const char *, const char *) ;
  void train() ;
  void initContentConfigure(const char * , std::map<std::string,std::string>& configureMap) ;
  void getFileFromPath(const char * _path, std::vector<std::string>& _fileVector) ;
  char * readline(FILE *input) ;
  void preprocessFeature(const char*, const char*);
  void secondTrain() ;
 private:
  std::string svmModelFile ;
  std::string svmConfigureFile ;
  std::string svmPositiveFeaturePath ;
  std::string svmNegetiveFeaturePath ;

  svm_parameter param ;
  svm_problem prob ;
  svm_model *model ;
  svm_node * nodeSpace ;
  
};










#endif

